version

use data_replication, clear

global y "incidentdum"
global c "growth LGDPpc sanDtylag polconiii ucdp_armedconflictdummy trade incpeaceyrs"
global d "d1970s d1980s d1990s d2000s"
global f "i.ccode" // country fixed effects


*** Table 1 ***
logit $y L.PT_attempt_dum $c $d $f, robust cluster(ccode)
outreg2 using table1, dec(3) excel word replace
logit $y L.elite $c $d $f, robust cluster(ccode)
outreg2 using table1, dec(3) excel word
logit $y gwf_lnduration1 $c $d $f, robust cluster(ccode)
outreg2 using table1, dec(3) excel word
logit $y arch_lndura $c $d $f, robust cluster(ccode)
outreg2 using table1, dec(3) excel word
logit $y arch_irregenter##c.arch_lndura $c $d $f, robust cluster(ccode)
outreg2 using table1, dec(3) excel word



*** Figure 1 ***
logit $y arch_irregenter##c.arch_lndura $c $d, robust cluster(ccode)
margins, dydx(arch_irregenter) at(arch_lndura=(0(0.1)4)) vsquish
marginsplot, recastci(rline) recast(line) ///
	yline(0, lpattern(solid) lwidth(thin)) ///
	xtitle("Leader Tenure", size(4))  ///
	ytitle("Effect of Irregular Entry", size(4)) ///
	title("") xscale(r(0 1 4)) ///
	plotregion(fcolor(white)) graphregion(fcolor(white)) ///
	legend(off) scheme(s1mono) saving(figure2.gph, replace) 


		
*** Table 2 ***
logit $y L.Banks_demo $c $d $f, robust cluster(ccode)
outreg2 using table2, dec(3) excel word replace
logit $y L.speed_antigovt_national $c $d $f, robust cluster(ccode)
outreg2 using table2, dec(3) excel word 
logit $y L.navco $c $d $f, robust cluster(ccode)  
outreg2 using table2, dec(3) excel word 
logit $y L.navco_viol $c $d $f, robust cluster(ccode)
outreg2 using table2, dec(3) excel word 
logit $y L.navco_below1000 $c $d $f, robust cluster(ccode)
outreg2 using table2, dec(3) excel word 
logit $y L.navco_above1000 $c $d $f, robust cluster(ccode)
outreg2 using table2, dec(3) excel word 
logit $y L.navco_above10000 $c $d $f, robust cluster(ccode)
outreg2 using table2, dec(3) excel word 

